package com.hzncc.flowable_diboot.project_contracts.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.diboot.core.entity.BaseModel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
* 项目类合同金额 Entity 定义
* @author MyName
* @version 1.0
* @date 2024-09-27
* Copyright © MyCorp
*/

@TableName("mdl_project_contract_amount")
@Getter @Setter @Accessors(chain = true)
@EqualsAndHashCode(callSuper=false)
public class ProjectContractAmount extends BaseModel {
    private static final long serialVersionUID = 1574707488556748627L;

    /**
     * 租户
     */
    @NotNull(message = "租户不能为空")
    @TableField()
    private String tenantId;

    /**
     * 合同采购总金额
     */
    @TableField()
    private BigDecimal contractPurchaseTotalAmount;

    /**
     * 合同销售总金额
     */
    @TableField()
    private BigDecimal contractSalesTotalAmount;

    /**
     * 折扣/毛利%
     */
    @TableField()
    private BigDecimal discount;

    /**
     * 是否退税
     */
    @TableField()
    private Boolean isTaxRefunded;

    /**
     * 合同退税总价
     */
    @TableField()
    private BigDecimal contractTaxRefundTotalPrice;

    /**
     * 综合毛利
     */
    @TableField()
    private BigDecimal comprehensiveGrossProfit;

    /**
     * 退税收毛利率%
     */
    @TableField()
    private BigDecimal taxRefundGrossProfitMarginPercentage;

    /**
     * 已收款金额
     */
    @TableField()
    private BigDecimal collectedAmount;

    /**
     * 未收款金额
     */
    @TableField()
    private BigDecimal uncollectedAmount;

    /**
     * 实际合同销售总价
     */
    @TableField()
    private BigDecimal actualContractSalesTotalPrice;

    /**
     * 币种
     */
    @Length(max=100, message="币种长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String currency;

    /**
     * 汇率
     */
    @TableField()
    private BigDecimal exchangeRate;

    /**
     * 要求完成时间
     */
    @TableField()
    private LocalDateTime requiredCompletionTime;

    /**
     * 实际完成时间
     */
    @TableField()
    private LocalDateTime actualCompletionTime;

    /**
     * 付款方式
     */
    @TableField()
    private String payMehtod;

    /**
     * 约定交货期
     */
    @TableField()
    private String agreedDeliveryTime;

    /**
     * 交货日期
     */
    @TableField()
    private LocalDateTime deliveryTime;

    /**
     * 质保期
     */
    @TableField()
    private String warrantyPeriod;

    /**
     * 备注
     */
    @Length(max=200, message="备注长度应小于200")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String remark;

    /**
     * 项目类合同Id
     */
    @TableField()
    private String contractId;

    /**
     * 合同项目类采购总额
     */
    @TableField()
    private BigDecimal contractProjectPurchaseTotal;

    /**
     * 合同项目类销售总额
     */
    @TableField()
    private BigDecimal contractProjectSaleTotal;

    /**
     * 销售费用类采购总额
     */
    @TableField()
    private BigDecimal salesExpensePurchaseTotal;

    /**
     * 销售费用类销售总额
     */
    @TableField()
    private BigDecimal salesExpenseSaleTotal;

    /**
     * 无成本类采购总额
     */
    @TableField()
    private BigDecimal noCostPurchaseTotal;

    /**
     * 无成本类销售总额
     */
    @TableField()
    private BigDecimal noCostSaleTotal;

    /**
     * 自制软件类采购总额
     */
    @TableField()
    private BigDecimal selfMadeSoftwarePurchaseTotal;

    /**
     * 自制软件类销售总额
     */
    @TableField()
    private BigDecimal selfMadeSoftwareSaleTotal;


}